package com.intelligent.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import io.swagger.models.auth.In;
import lombok.Data;

/**
 *
 * @TableName delivery_management_detail
 */
@TableName(value ="delivery_management_detail")
@Data
public class DeliveryManagementDetail implements Serializable {
    /**
     * 记录ID（自增主键）
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 关联发货单主表ID
     */
    private Long deliveryOrderId;

    /**
     * 产品ID
     */
    private Long productId;


    /**
     * 发货数量
     */
    private BigDecimal quantity;

    /**
     * 单价
     */
    private BigDecimal unitPrice;

    /**
     * 金额（数量×单价）
     */
    private BigDecimal amount;

    /**
     * 关联单位表
     */
    private Integer batchNumber;

    /**
     * 生产日期
     */
    private Date productionDate;

    /**
     * 备注
     */
    private Integer status;

    /**
     * 发货单号（临时字段，用于显示）
     */
    @TableField(exist = false)
    private String deliveryOrderNo;

    /**
     * 出库状态文本（临时字段，用于显示）
     */
    @TableField(exist = false)
    private String outboundStatusText;

    /**
     * 产品名称（临时字段，用于显示）
     */
    @TableField(exist = false)
    private String productName;

    /**
     * 产品编号（临时字段，用于显示）
     */
    @TableField(exist = false)
    private String productCode;

    /**
     * 产品规格（临时字段，用于显示）
     */
    @TableField(exist = false)
    private String specification;

    /**
     * 产品分类（临时字段，用于显示）
     */
    @TableField(exist = false)
    private String category;

    /**
     * 单位名称（临时字段，用于显示）
     */
    @TableField(exist = false)
    private String unitName;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DeliveryManagementDetail other = (DeliveryManagementDetail) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getDeliveryOrderId() == null ? other.getDeliveryOrderId() == null : this.getDeliveryOrderId().equals(other.getDeliveryOrderId()))
            && (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
            && (this.getQuantity() == null ? other.getQuantity() == null : this.getQuantity().equals(other.getQuantity()))
            && (this.getUnitPrice() == null ? other.getUnitPrice() == null : this.getUnitPrice().equals(other.getUnitPrice()))
            && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
            && (this.getBatchNumber() == null ? other.getBatchNumber() == null : this.getBatchNumber().equals(other.getBatchNumber()))
            && (this.getProductionDate() == null ? other.getProductionDate() == null : this.getProductionDate().equals(other.getProductionDate()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDeliveryOrderId() == null) ? 0 : getDeliveryOrderId().hashCode());
        result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
        result = prime * result + ((getQuantity() == null) ? 0 : getQuantity().hashCode());
        result = prime * result + ((getUnitPrice() == null) ? 0 : getUnitPrice().hashCode());
        result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
        result = prime * result + ((getBatchNumber() == null) ? 0 : getBatchNumber().hashCode());
        result = prime * result + ((getProductionDate() == null) ? 0 : getProductionDate().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", deliveryOrderId=").append(deliveryOrderId);
        sb.append(", productId=").append(productId);
        sb.append(", quantity=").append(quantity);
        sb.append(", unitPrice=").append(unitPrice);
        sb.append(", amount=").append(amount);
        sb.append(", batchNumber=").append(batchNumber);
        sb.append(", productionDate=").append(productionDate);
        sb.append(", remark=").append(status);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
